﻿<%@ Page Language="C#" %>
<%@ import Namespace="System.Data" %>
<%@ import Namespace="System.Data.OleDb" %>
<%
    string colname = Request.QueryString["colname"];
  OleDbConnection conn = null;
    try
  {
      
      conn = DBOp.DbConn;
      OleDbCommand comm = conn.CreateCommand();
      comm.CommandText = "select DISTINCT j." + colname + " from jz j";
      DataTable dt = new DataTable();
      OleDbDataAdapter oda = new OleDbDataAdapter(comm);
      oda.Fill(dt);
    %>
    { datastore: [ 
    <%
    string output = "";
    string opstring = "";
    foreach (DataRow dr in dt.Rows)
    {
        opstring = dr[0].ToString();
        if (!string.IsNullOrEmpty(opstring))
        {
            output += "{value: '" + opstring + "',display:'" + opstring + "'},";
        }
    }
    output = output.Trim(',');
 
%><%=output %><% }
  catch (Exception ex) { }
  finally
  {
      if (conn != null)
          conn.Close();
  } %>
]}